#include "gofgame/dungeonkeeper/game/BackgroundLayer.h"
#include "gofgame/dungeonkeeper/configuration/LevelConf.h"
#include "gofgame/dungeonkeeper/game/LevelScene.h"


using namespace gofgame::dungeonkeeper::game;
using namespace gofgame::dungeonkeeper::configuration;
USING_NS_CC;

bool BackgroundLayer::init(){
	bool rect = false;
	do 
	{
		CC_BREAK_IF(!CCLayer::init());
		rect = true;
		
	} while (0);
	return rect;
}

void BackgroundLayer::setBackgroundImage(const char *fileName){
	fileName = "level1Bg.png";
	CCSprite *bgSprite = CCSprite::create(fileName);
	CCSize winSize = CCDirector::sharedDirector()->getWinSize();
	bgSprite->setPosition(ccp(winSize.width/2,winSize.height/2));
	bgSprite->setTag(50);
	this->addChild(bgSprite);
}


CCSize BackgroundLayer::getBgContentSize(){
	CCSprite *bgSprite  = (CCSprite *)this->getChildByTag(50);
	return bgSprite->getContentSize();
}
